package Others;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

import MainMethods.FileWr;
import MainMethods.HoverImage;
import MainMethods.Screenshot;



public class Membership {

	WebElement element;
	HoverImage hover = new HoverImage();
	Screenshot scsh = new Screenshot();

	// get premium membership
	public void getPremiumAccess(WebDriver driver, FileWr file) {
		// get full access
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {

			e.printStackTrace();
		}

		driver.findElement(By.xpath("//*[@id=\"full-access-btn\"]")).click();
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {

			e.printStackTrace();
		}
		driver.findElement(By.id("confirm-btn")).click();
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {

			e.printStackTrace();
		}
		if (hover.doesElementExist(driver, By.xpath("//*[@id=\"receipt-wrapper\"]")) == true) {
			file.writeFile("upgrading of membership - PASSED");
			System.out.println("upgrading of membership finished");
		} else {
			file.writeFile("upgrading of membership - FAILED");
		}
	}

}
